import java.util.List;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.nodeSize(root);
        System.out.println("结点的个数："+binaryTree.size);
        System.out.println("结点的个数："+binaryTree.nodeSize1(root));
        System.out.println("叶子结点的个数："+binaryTree.getLeafSize1(root));
        System.out.println("树的高度："+binaryTree.getHeight(root));
        binaryTree.getLeafSize(root);
        System.out.println(binaryTree.leafSize);
        System.out.println();
        List<BinaryTree.TreeNode> ret = binaryTree.preOrder1(root);
        for (BinaryTree.TreeNode x : ret) {
            System.out.print(x.val + " ");
        }
        System.out.println();
        System.out.println("===");

       binaryTree.inOrder(root);
        System.out.println();
        List<BinaryTree.TreeNode> ret1 = binaryTree.inOrder1(root);
        for(BinaryTree.TreeNode x : ret1){
            System.out.print(x.val + " ");
        }
        System.out.println();
        System.out.println("===");

        binaryTree.postOrder(root);
        System.out.println();
        List<BinaryTree.TreeNode> ret2 = binaryTree.postOrder1(root);
        for(BinaryTree.TreeNode x : ret2){
            System.out.print(x.val + " ");
        }
    }
}
